home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Super PC 34
/
Super PC 34 (Shareware).iso
/
spc
/
UTIL
/
DJGPP2
/
V2
/
DJTST200.ZIP
/
tests
/
libc
/
posix
/
sys
/
stat
/
leak.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1995-04-18
|
341 b
|
21 lines
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
int
main(int argc, char **argv)
{
int i;
struct stat s;
for (i=0; i<20; i++)
{
int fd = open("nul", O_RDONLY);
close(fd);
printf("loop %d fd %d\n", i, fd);
stat(argc > 1 ? argv[1] : "leak.c", &s);
}
return 0;
}